-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(compile): add Amber version, fix #181 #245
Conversation
what if we add some more info to it? like date of compilation, source hash, author/license label, etc.. but that would also mean that primive approach won't do and we would have to use a templating engine. i would suggest tinytemplate, which only dependency is |
I think that the date is a good idea but about the rest is too much for what the project is right now. |
Co-authored-by: Phoenix Himself <pkaras.it@gmail.com>
Co-authored-by: Phoenix Himself <pkaras.it@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The build now fails because it requires Local
from chrono library. Please add the library to dependencies in Cargo.toml
(Try cargo add chrono
) and import it in the top of the file with:
extern crate chrono;
use chrono::prelude::*;
This comment was marked as outdated.
This comment was marked as outdated.
I don't know how to fix the cargo.lock conflict, suggestions? |
I'll handle this. For now I think we can accept the incoming changes and recompile the code. You could also remove the lock temporarily and see if recompilation will work with the newly created one. Not sure if this is the right way to resolve Cargo.lock conflicts but this has worked for me ever since |
Locally everything works on building (already tried). |
I know. It's that when you pull the |
Resolved conflicts |
@Mte90 at some point when running tests there is this error: Can you check what produces it? |
generate a sh code like this:
|
Now add a comment |
@b1ek can you take a look? |
I can confirm that now works:
|
The output now:
|
src/compiler.rs
Outdated
include_str!("header.sh"), | ||
"# version:", option_env!("CARGO_PKG_VERSION").unwrap(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Mte90 sorry for nitpicking, but can we remove that first space on the line with # version
?
include_str!("header.sh"), | |
"# version:", option_env!("CARGO_PKG_VERSION").unwrap(), | |
include_str!("header.sh").trim_end(), | |
"\n# version:", option_env!("CARGO_PKG_VERSION").unwrap(), |
* feat(compile): add Amber version, fix amber-lang#181 * Update src/compiler.rs Co-authored-by: Phoenix Himself <pkaras.it@gmail.com> * Update src/header.sh Co-authored-by: Phoenix Himself <pkaras.it@gmail.com> * review * fix(cargo): updated * fix(chrono): no errors * fix(compiler): added bash comment * fix(compiler): empty space --------- Co-authored-by: Phoenix Himself <pkaras.it@gmail.com>
Fix #181